package com.jservice.web.authc;

import com.jfinal.core.Controller;
import com.jservice.web.base.JBaseValidator;

/**
 * LoginValidate
 *
 * @Author cwledit
 * @DATE 2017/5/30.
 */
public class AuthcValidate extends JBaseValidator{

    @Override
    protected void validate(Controller controller) {

        validateString("username", 5, 16, ERROR_KEY, "请输入用户名!");
        validateString("password", 6, 18, ERROR_KEY, "请输入密码!");
    }

    @Override
    protected void handleError(Controller controller) {
        controller.keepPara("username", "password");
        controller.render("/admin/login/login.html");
    }
}
